package com.example.demo.dao;

import com.example.demo.bean.Department;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DepartmentDao {

    /*查询*/
    @Select("select * from department")
    List<Department> department();

    /*新增数据*/
    @Insert("insert into department (department1) values (#{department1})")
    void insert(String department);

    /*删除数据*/
    @Select("delete from department where department1 = #{department1}")
    void delete(String department);

    /*修改数据*/
    @Update("update department set department1 = #{department1} where d_id = #{d_id}")
    void update(Department department);
}
